#pragma once

#ifndef BATENEMY_H
#define BATENEMY_H

#include "Entity.h"
#include "StateMachine.h"
#include "Particle.h"
#include "Gravity.h"
#include "Drag.h"
#include "Spring.h"
#include "Level.h"
#include "Collision.h"
#include "Contact.h"
#include "ForceRegistry.h"
#include "ForceGenerator.h"
#include "AnimationPlayer.h"

class BatEnemy : public Entity
{
public:
	AnimationPlayer* batAnims;
	D3DXVECTOR3 direction;
	Particle particle;
private:
	D3DXVECTOR3 topLeft;
	D3DXVECTOR3 bottomRight;
	D3DXVECTOR3 oldOffset;
	D3DXVECTOR3 newOffset;
	D3DXVECTOR3 movement;
	Drag drag;
	StateMachine<BatEnemy> stateMachine;
public:
	BatEnemy(AnimationPlayer* batAnims, D3DXVECTOR3 position, D3DXVECTOR3 topLeft, D3DXVECTOR3 bottomRight);
	virtual void setPosition(D3DXVECTOR3 newPosition)
	{
		position = newPosition;
		particle.position = newPosition;
	}
	IDirect3DTexture9* getTexture()
	{
		return texture;
	}
	~BatEnemy() { delete batAnims; }
	void update(float frameTime);
	void draw(ID3DXSprite* sprite);
	void handleMessage(Message message);
};

#endif